/*** Class Name: iFulfillBatchJobTest
 * Author: Accenture
 * Date: 19-July-2011
 * Requirement/Project Name: iFulfill
 * Requirement Description: Test class for iFulfillBatchJob
 **/

@istest
private  class iFulfillBatchJobTest 
{
    /**
    *  Test method 
    */
    static testMethod void testBatch() 
    {   
        Workflow_Definition__c w1 = new Workflow_Definition__c(Workflow_Name__c='w1');      
        Workflow_Definition__c w2 = new Workflow_Definition__c(Workflow_Name__c='w2');
        List<Workflow_Definition__c> workDefList = new List<Workflow_Definition__c>();
        List<Fullfilment_Item__c> fulFillList = new List<Fullfilment_Item__c>();
        
        workDefList.add(w1);
        workDefList.add(w2);
       
        
       Workflow_Definition__c WD = new Workflow_Definition__c();
        WD.Status__c = 'Pending Inactivation';
        WD.Workflow_Name__c = 'WD';
        WD.Version__c = 1;
        workDefList.add(WD );
         insert workDefList;
        
       
         Fullfilment_Item__c FI4 = new Fullfilment_Item__c(Main_Listing_Phone_Number__c = '104560',
                     Listed_Name__c ='XIne',Heading_Name__c ='Test Get grouped',Item_Id__c = 'Item id123' ,
                     Product_Code__c ='p1',UDAC__c ='Udac1',Region__c = 'region1',
                     Transaction_Type__c ='New',
                     status__c = 'In Progress',
                     Workflow_Code__c = WD.id);
        insert FI4;
        
        
        Fullfilment_Item__c f1 = new Fullfilment_Item__c ();
        Fullfilment_Item__c f2 = new Fullfilment_Item__c ();

        iFulfillBatchJob reassign = new iFulfillBatchJob();
        ID batchprocessid = Database.executeBatch(reassign);
        reassign.execute(null, workDefList);
        reassign.finish(null);
        reassign.start(null);
            
    }

}